package com.grad.webstudy.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * @Description:
 * @Author: zjf
 * @Date: 2020/2/15 16:11.
 */
public class CourseCommentVo {

    private Integer id;

    private String content;

    private Integer courseId;

    private Integer courseDetailId;

    private Integer userId;

    private String userName;

    private String headImage;

    @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date time;


    public CourseCommentVo() {
    }


    public CourseCommentVo(Builder builder) {
        this.id = builder.id;
        this.content = builder.content;
        this.courseId = builder.courseId;
        this.courseDetailId = builder.courseDetailId;
        this.userId = builder.userId;
        this.userName = builder.userName;
        this.headImage = builder.headImage;
        this.time = builder.time;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getHeadImage() {
        return headImage;
    }

    public void setHeadImage(String headImage) {
        this.headImage = headImage;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getCourseId() {
        return courseId;
    }

    public void setCourseId(Integer courseId) {
        this.courseId = courseId;
    }

    public Integer getCourseDetailId() {
        return courseDetailId;
    }

    public void setCourseDetailId(Integer courseDetailId) {
        this.courseDetailId = courseDetailId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "CourseCommentVo{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", courseId=" + courseId +
                ", courseDetailId=" + courseDetailId +
                ", userId=" + userId +
                ", userName='" + userName + '\'' +
                ", headImage='" + headImage + '\'' +
                ", time=" + time +
                '}';
    }

    public static class Builder{
        private Integer id;

        private String content;

        private Integer courseId;

        private Integer courseDetailId;

        private Integer userId;

        private String userName;

        private String headImage;

        @JsonFormat( pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date time;


        public Builder setId(Integer id) {
            this.id = id;
            return this;
        }

        public Builder setContent(String content) {
            this.content = content;
            return this;
        }

        public Builder setCourseId(Integer courseId) {
            this.courseId = courseId;
            return this;
        }

        public Builder setCourseDetailId(Integer courseDetailId) {
            this.courseDetailId = courseDetailId;
            return this;
        }

        public Builder setUserId(Integer userId) {
            this.userId = userId;
            return this;
        }

        public Builder setUserName(String userName) {
            this.userName = userName;
            return this;
        }

        public Builder setHeadImage(String headImage) {
            this.headImage = headImage;
            return this;
        }

        public Builder setTime(Date time) {
            this.time = time;
            return this;
        }
        public CourseCommentVo build(){
            return new CourseCommentVo(this);
        }
    }
}
